Skip to content

Comments

Build/Test Tools: Expand visual regression test coverage for admin pages.#10914

Open
josephfusco wants to merge 3 commits intoWordPress:trunkfrom
josephfusco:add/visual-regression-tests-admin-reskin
Open

Build/Test Tools: Expand visual regression test coverage for admin pages.#10914
josephfusco wants to merge 3 commits intoWordPress:trunkfrom
josephfusco:add/visual-regression-tests-admin-reskin

Conversation

@josephfusco
Copy link

@josephfusco josephfusco commented Feb 12, 2026

Summary

Expands admin visual regression coverage from 22 to 37 screenshots ahead of the 7.0 admin reskin.

Replaces 22 hand-written tests with a data-driven pages array and a single test loop. Volatile elements are stabilised in two layers: a global screenshot.css (injected at capture time via Playwright's stylePath) and per-page mask selectors.

Key changes (3 files):

  • screenshot.css (new) — hides volatile elements (dates, gravatars, notices, version strings, block editor modals) globally; uses visibility: hidden to preserve layout, except notices and modals which use display: none since they may not exist in the DOM between runs
  • playwright.config.js — adds HTML reporter, full-page capture, 1 % diff tolerance, animation disabling, and single-worker CI serialisation
  • visual-snapshots.test.js — data-driven test loop with section-based test.describe nesting for grouped HTML reports, setup/teardown lifecycle via REST API, per-page masks, and a waitForPageReady helper for network/font/jQuery/focus settling

Pages covered

Section Pages
Dashboard Dashboard, Updates
Posts All Posts, Add New Post, Edit Post, Categories, Tags
Media Media Library, Add Media
Pages All Pages, Add New Page, Edit Page
Comments Comments
Appearance Themes, Widgets, Menus, Theme File Editor
Plugins Plugins, Add New Plugin, Plugin File Editor
Users All Users, Add User, Your Profile
Tools Available Tools, Import, Export, Export Personal Data, Erase Personal Data, Site Health
Settings General, Writing, Reading, Discussion, Media, Permalink, Privacy
(unauth) Login

Testing

npm run test:visual -- --update-snapshots   # generate baselines
npm run test:visual                         # compare against baselines

Diff images land in artifacts/; an HTML report opens automatically.

Trac ticket

https://core.trac.wordpress.org/ticket/62671

@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props joefusco.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@josephfusco josephfusco marked this pull request as draft February 12, 2026 20:07
@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@josephfusco josephfusco force-pushed the add/visual-regression-tests-admin-reskin branch from 83cbdcd to 014f376 Compare February 18, 2026 18:23
@josephfusco josephfusco changed the title Tests: Add visual regression tests for admin reskin pages Tests: Expand visual regression coverage and add comparison tooling Feb 18, 2026
@josephfusco josephfusco marked this pull request as ready for review February 18, 2026 20:31
@josephfusco josephfusco force-pushed the add/visual-regression-tests-admin-reskin branch 14 times, most recently from b741ba1 to fff0a92 Compare February 20, 2026 19:51
@josephfusco josephfusco changed the title Tests: Expand visual regression coverage and add comparison tooling Tests: Add visual regression testing for WordPress admin pages. Feb 20, 2026
@josephfusco josephfusco changed the title Tests: Add visual regression testing for WordPress admin pages. Build/Test Tools: Expand visual regression test coverage for admin pages. Feb 20, 2026
@josephfusco josephfusco force-pushed the add/visual-regression-tests-admin-reskin branch 7 times, most recently from c537f84 to c26d870 Compare February 22, 2026 03:36
@josephfusco josephfusco force-pushed the add/visual-regression-tests-admin-reskin branch 3 times, most recently from 9a7848f to 18d19f8 Compare February 22, 2026 18:40
josephfusco and others added 2 commits February 22, 2026 13:40
Normalize volatile UI for visual tests and reorganize snapshot suites. Switch admin notices from visibility:hidden to display:none to avoid layout shifts across runs, and hide block-editor modals. In tests, blur any focused element on page ready to avoid focus-ring diffs; group pages into section-based describe blocks for a nested report; update and add mask selectors (use .editor-visual-editor for block editor); warn when a mask selector matches no elements; and preserve per-test setup/teardown behavior. These changes reduce flaky diffs and make the HTML report easier to navigate.
@josephfusco josephfusco force-pushed the add/visual-regression-tests-admin-reskin branch 2 times, most recently from e59ea20 to f75de1f Compare February 23, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant